$(function () {
    vm.getInfo();
});

var vm = new Vue({
	el:'#rrapp',
	data:{
        totalResult: {},
        newResult: [],
        recomeResult: [],
        startDate: "",
        endDate: "",
        queryStr: "查询"
	},

    mounted: function () {
        console.log(laydate)
        laydate.render({
            elem: '#startDate',
            type:'date',
            done: (value) => {
                this.date = value;
                vm.startDate = value;
            }
        }),
        laydate.render({
            elem: '#endDate',
            type:'date',
            done: (value) => {
                this.date = value;
                vm.endDate = value;
            }
        })
    },

	methods: {

	    
	    query: function () {
                vm.getInfo();
                vm.queryStr = "查询中...";
        },
		getInfo: function(){
	        console.log(vm.startDate);
            $.ajax({
                type: "GET",
                url: baseURL + "noc/nocresult/getResult",
                data: "startDate="+vm.startDate+"&endDate="+vm.endDate,
                success: function(r){
                    if(r.code === 0){
                        console.log(r);
                        var total =  r.result.totalResult;
                        if(total.length>0){
                            vm.totalResult = total[0];
                        }
                        vm.newResult = r.result.newResult;
                        vm.recomeResult = r.result.recomeResult;

                    }else{
                        //layer.alert(r.msg);

                    }

                    vm.queryStr = "查询";
                }
            });
		}


	}
});